import java.util.Map;
import java.util.Set;

public class demo3 {
    public static void main(String[] args) {
        //键和set集合一样不能重复，map的of方法参数有上限，最多十个键值对
        Map<String, String> map= Map.of("张三", "北京", "李四", "上海", "王五", "广州",
                "青霖", "深圳", "凯多", "四川", "路飞", "武汉");
        Set<String> keys= map.keySet();
        for (String key : keys) {
            String s = map.get(key);
            System.out.println(key+"在"+s);
        }
        System.out.println(" ---------------------------------");
        Set<Map.Entry<String, String>> entries = map.entrySet();
        for (Map.Entry<String, String> entry : entries) {
            System.out.println(entry);
        }
    }
}
